@extends('layouts.default') @section('main')
    <link rel="stylesheet" href="/css/uniform.css" />
    <link rel="stylesheet" href="/css/select2.css" />
    <div id="content">
        <div id="content-header">
            <div id="breadcrumb">
                <a href="{{url('home')}}" title="返回首页" class="tip-bottom"><i class="icon-home"></i> 首页</a>
                <a href="{{url('institution/list')}}" class="tip-bottom">机构管理</a>
                <a href="#" class="current">机构列表</a></div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    @if(in_array('add',$actions))<a href="{{url('institution/create')}}"><button class="btn">新增</button></a>@endif
                    <form action="{{url('institution/search')}}" method="post">
                        <table>
                            <tr>
                                <th>
                                    <label >机构名称 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <input type="text" class="span11" name="subject"  placeholder="机构名称" />
                                    </div>
                                </th>
                                <th>
                                    <label >法人代表 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <input type="text" class="span11" name="represent"  placeholder="法人代表" />
                                    </div>
                                </th>
                                <th>
                                    <label >类型 :</label>
                                </th>
                                <th>
                                    <div class="controls">
                                        <select  name="type" class="span11" >
                                            <option value="">请选择</option>
                                            <option value="law">法律机构</option>
                                            <option value="invest">投资机构</option>
                                            <option value="makerspace">创客空间机构</option>
                                            <option value="finance">经济机构</option>
                                        </select>
                                    </div>
                                </th>

                                <th>
                                    <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                    <div class="controls">
                                        <button type="submit" class="btn btn-info">查询</button>
                                    </div>
                                </th>
                            </tr>
                        </table>
                    </form>
                    <div class="widget-box">
                        <div class="widget-title"> <span class="icon"><i class="icon-th"></i></span>
                            <h5>机构列表</h5>
                        </div>
                        <div class="widget-content nopadding">
                            <table class="table table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th>名称</th>
                                    <th>电话</th>
                                    <th>所在地区</th>
                                    <th>法人代表</th>
                                    <th>类型</th>
                                    <th>详情</th>
                                    <th>状态（屏蔽否）</th>
                                    <th>是否推荐</th>
                                    <th>是否置顶</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($lists as $key => $list)
                                    <tr class="gradeX">
                                        <td title="{{$list->subject}}">{{cut_str($list->subject,12,'...')}}</td>
                                        <td>{{$list->tel}}</td>
                                        <td>@if($list->zone) {{$list->zone->name}} @endif</td>
                                        <td>{{$list->represent}}</td>
                                        <td>@if($list->type=='law') 法律机构 @elseif($list->type=='invest') 投资机构 @elseif($list->type=='makerspace') 创客空间机构 @elseif($list->type=='finance') 经济机构 @endif </td>
                                        <td><a href="{{ url('institution/detail?uid='.$list->id) }}">点击查看</a></td>
                                        <td>@if($list->status == 1)<i class="icon-ok"></i>@elseif($list->status == 0)<i class="icon-remove"></i>@endif</td>
                                        <td>@if($list->recommend == 1)<i class="icon-ok"></i>@elseif($list->recommend == 0)<i class="icon-remove"></i>@endif</td>
                                        <td>@if($list->stick == 1)<i class="icon-ok"></i>@elseif($list->stick == 0)<i class="icon-remove"></i>@endif</td>
                                        <td class="center">
                                            @if(in_array('edit',$actions))<a data-original-title="编辑" class="tip" href="{{url('institution/edit?id='.$list->id)}}"><i class="icon-pencil"></i></a>@endif
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                        </div>
                    </div>
                <?php echo $lists->appends(['subject' => $subject,'type' => $type,'represent' => $represent])->render();?>
                </div>
            </div>
        </div>
    </div>
    <script src="/js/matrix.tables.js"></script>
@stop
